﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AppEnvironment.Lib
{
    public class AppForType
    {
        //intentionally empty
    }

    public class AppForType<T> : AppForType
    {
        public event Action<AppBeforeNewForTypeArgs<T>> OnBeforeNew;
        public event Action<AppAfterNewForTypeArgs<T>> OnAfterNew;

        internal void FireOnBeforeNew(AppBeforeNewForTypeArgs<T> args)
        {
            //note this is not thread-safe: meant to only run on current thread via App.CurrentThread
            if (OnBeforeNew != null)
            {
                OnBeforeNew(args);
            }
        }

        internal void FireOnAfterNew(AppAfterNewForTypeArgs<T> args)
        {
            //note this is not thread-safe: meant to only run on current thread via App.CurrentThread
            if (OnAfterNew != null)
            {
                OnAfterNew(args);
            }
        }
    }
}
